﻿using System.Collections.Generic;

namespace SameGame.Model
{
	public class CFrame
	{
		private List<CItem> highlightedItems = new List<CItem>();
		private List<CItem> replacedItems = new List<CItem>();

		public CFrame()
		{
			// TODO: the array are not created
			//highlightedItems.Initialize();
			//removedItems.Initialize();
			//replacedItems.Initialize();
		}

		public IEnumerable<CItem> getHighlighted()
		{
			return highlightedItems;
		}

		public IEnumerable<CItem> getReplaced()
		{
			return replacedItems;
		}

		public void Clear()
		{
			highlightedItems.Clear();
			replacedItems.Clear();
		}

		public void AddHighlighted(CItem item)
		{
			highlightedItems.Add(item);
		}

		public void AddReplaced(CItem item)
		{
			if (!replacedItems.Contains(item)) {
				replacedItems.Add(item);
			}
		}

		public int Score
		{
			get{
				return (highlightedItems.Count - 1) * (highlightedItems.Count - 1);
			}
		}

	}
}
